package com.its.common.kafka.consumer;

import org.apache.kafka.clients.consumer.ConsumerRecord;

/**
 * @Author xiaxp
 * @Date 2021-11-30 10:32
 * @Description
 */
public abstract class AbstractKafkaConsumerWorker implements Runnable {
    protected ConsumerRecord<String, String> record;

    public AbstractKafkaConsumerWorker(){}

    protected void setRecord(ConsumerRecord record){
        this.record = record;
    }

    @Override
    public void run() {
        this.handleRecord(record);
    }

    /** 处理记录
     * FE 数据入库操作
     * @param record
     */
    public abstract void handleRecord(ConsumerRecord record);
}
